package com.doit.demo01;

import java.io.File;
import java.io.FileFilter;

public class test01_listfiles {
    public static void main(String[] args) {
        File file = new File("d:\\work\\abc");

        show(file);
    }
    public static void show(File dir){
        File[] dirr =dir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                if (pathname.isDirectory())
                    show(pathname);
                return pathname.getName().toLowerCase().endsWith(".java");
            }
        });
        for (File file1 : dirr) {
            System.out.println(file1);
        }
    }
}
